﻿<%
class ActionForeach
	public sub index
		Mo.Assign "title","each/foreach演示"
		Mo.display "home:top"
		F.echo "<h3>遍历可枚举变量：</h3>"
		dim dict:set dict = F.activex("scripting.dictionary")
		dict("name")="moaspenginer"
		dict("age")=1
		dict("location")="杭州"
		F.each dict,GetRef("CallBackEnum")
		
		F.echo "<h3>遍历get变量：</h3>"
		F.foreach F.get__,GetRef("CallBack")
		
		F.echo "<h3>遍历post变量：</h3>"
		F.post "name","moaspenginer" '因为是get方式访问的，这里设置一项post
		F.foreach F.post__,GetRef("CallBack")
		
		F.echo "<h3>遍历server变量：</h3>"
		F.foreach F.server__,GetRef("CallBack")
		Mo.display "home:foot"
	end sub
end class
function CallBack(q,v,src)
	F.echo q & " = " & v & "<br />" & vbcrlf
end function
function CallBackEnum(q,src)
	F.echo q & " = " & src(q) & "<br />" & vbcrlf
end function
%>